<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Symbol</title>
</head>
<body>
<script>
    //向对象种添加方法 up down
    // let game = {
    //
    // }
    //
    // let methods = {
    //     up: Symbol(),
    //     down: Symbol()
    // }
    //
    // game[methods.up] = function (){
    //     console.log("I can up");
    // }
    //
    // game[methods.down] = function (){
    //     console.log("I can down");
    // }
    // console.log(game);

    let youxi = {
        name: "lang",
        [Symbol('say')]: function (){
            console.log("I can speak");
        },
        [Symbol('zibao')]: function (){
            console.log("I can ");
        }
    }
    console.log(youxi);
</script>
</body>
</html>